﻿define('specialities',
    ['jquery', 'ko', 'basicObject', 'speciality', 'specialitiesSearch'],
function ($, ko, basicObject, speciality, specialitiesSearch) {
    var specialities = function () {
        var self = this;
        
        var dateCellTemplate = '<span data-bind="css: \'kgCellText\', dateshower: $data.getProperty($parent)" />';
        var linkCellTemplate = '<div style="width: 100px"><a data-bind="css: \'kgCellText fill\'">Edit<a></div>';
        var columnsDefs = [
            { field: 'code', displayName: 'Speciality Code', width: '15%' },
            { field: 'title', displayName: 'Title', width: '43%' },
            { field: 'createdOn', cellTemplate: dateCellTemplate, displayName: 'Created On', width: '20%' },
            { field: 'id', cellTemplate: linkCellTemplate, displayName: 'Edit', width: '15%' }
        ];
        
            self.basicObject = ko.observable(new basicObject(columnsDefs, speciality, specialitiesSearch, "/api/Specialities/GetByPage", "currentView", "Speciality"));
        
        
    };

    return specialities;

});